﻿package  {
	
	import flash.display.MovieClip;
	import flash.geom.Point;
	import flash.events.*;
	
	public class GW extends MovieClip {
		
		var hero:Hero;
		var map:Map;
		public function GW() {
			map=new Map();
			hero=new Hero(map,this,new Point(240,160));
			addChild(hero);
			addEventListener(Event.ENTER_FRAME,update);
		}
		public function update(e:Event){
			var units:Vector.<Unit>=new Vector.<Unit>();
			for(var k=0;k<this.numChildren;k++){
				units.push(getChildAt(k));
			}
			while(units.length>0){
				var unit:Unit=units.pop();
				unit.update();
			}
		}
	}
	
}
